import Vue from 'vue'
import Router from 'vue-router'
import Layout from '@/views/layout/Layout'

Vue.use(Router)

export const constantRouterMap = [
  {path: '/login',component: () => import('@/views/login/LoginUser'),hidden: true,},
  {
    path: '/',
    component: Layout,
    redirect: '/indexList',
    meta:{ title:'出版社账号管理',icon: 'iconfont icon-yg-shujia'},
    children: [{
      path: 'indexList',
      name: 'IndexList',
      component: () => import('@/views/index/IndexList'),
      meta: { title: '出版社账号管理', icon: 'iconfont icon-yg-shujia', noCache: true },
    },{
      hidden: true,
      path: 'indexDetail',
      name: 'IndexDetail',
      component: () => import('@/views/index/IndexDetail'),
      meta: { title: '新建账号', noCache: true },
    }]
  },
  { path: '/404', redirect: '/',  hidden: true },
]

export default new Router({
  scrollBehavior: () => ({ y: 0 }),
  routes: constantRouterMap
})

export const asyncRouterMap = [

]

export const componentsMap = {
  // "Layout":Layout,
  // "RoleList":() => import('@/views/role/RoleList'),
  // "RoleDetail":() => import('@/views/role/RoleDetail'),
  // "WebUserList":() => import('@/views/webUser/WebUserList'),
  // "WebUserDetail":() => import('@/views/webUser/WebUserDetail'),
  // "ProductType":() => import('@/views/productType/ProductTypeList'),
  // "PinProduct":() => import('@/views/pinProduct/PinProductList'),
  // "Product":() => import('@/views/product/ProductList'),
  // "Order":() => import('@/views/order/OrderList'),
  // "Promote":() => import('@/views/promote/PromoteList'),
  // "DistributionSettingDetail":() => import('@/views/distribution/DistributionSettingDetail'),
  // "AgencyManagement":() => import('@/views/agency/AgencyManagement'),
  // "SubordinateList":() => import('@/views/agency/SubordinateList'),
  // "DistributionBillList":() => import('@/views/distribution/DistributionBillList'),
  // "WithdrawCash":() => import('@/views/withdrawCash/WithdrawCashAuditList'),
}
